package com.java.base.exercise.threadlocal;

/**
 * @Author RenPu
 * @Date 2021/8/28 10:25
 * @Version 1.0
 * @Description:
 **/
public class Thread_001 {

    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = () -> {
            int num = 0;
            try {
                while (num <= 10000) {

                    if (num % 100 == 0) {
                        System.out.println(num + ": 属于100的倍数");
                    }
                    num++;
                    Thread.sleep(10);
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        };


        Thread thread = new Thread(runnable);
        thread.start();
        Thread.sleep(5000);
        thread.interrupt();

    }
}
